package com.zmn.oms.persistence.interfaces.masterworking;

import com.zmn.oms.model.entity.masterworking.MasterWorking;
import com.zmn.oms.model.entity.masterworking.MasterWorkingQuery;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 类描述：工程师进行中工单持久层
 *
 * @author lujia
 * @date 2018-11-03 09:30:34
 */
public interface MasterWorkingDao {

    /**
     * 根据工程师ID 和 预约时间范围查询
     *
     * @param masterWorkingQuery
     * @return
     */
    List<MasterWorking> listMasterWorkingByQuery(MasterWorkingQuery masterWorkingQuery);

    /**
     * 根据工程师id查询进行中工单集合
     *
     * @param masterId 工程师id
     * @return 工单集合
     */
    List<MasterWorking> listMasterWorking(@Param("masterId") Integer masterId);

    /**
     * 工单列表查询
     *
     * @param workIdList
     * @return
     */
    List<MasterWorking> listMasterWorkingByWorkIdList(@Param("workIdList") List<Long> workIdList);

    /**
     * 根据工单ID查询
     *
     * @param workId
     * @return
     */
    MasterWorking findMasterWorkingByWorkId(Long workId);

    /**
     * 修改进行中工单
     *
     * @param masterWorking
     * @return 影响行数
     */
    int updateMasterWorkingByKey(MasterWorking masterWorking);

    /**
     * 新增进行中工单
     *
     * @param masterWorking 工单
     * @return
     */
    int insertMasterWorking(MasterWorking masterWorking);


    int updateWorkingDutyTimeByKey(MasterWorking masterWorking);

    /**
     * 删除进行中工单
     *
     * @param workId
     * @return 影响行数
     */
    int deleteMasterWorking(@Param("workId") Long workId);

    /**
     * 修改是否排版
     */
    int updateWorkingWaitSchedulingByKey(MasterWorking masterWorking);

    /**
     * 修改改派状态
     */
    int updateRedistributeStatusByKey(MasterWorking masterWorking);
}
